<?php


require "database.php";


$base=new Db;


$category_id=$_GET["category_id"];

$offset=$_GET["offset"];

$limit=$_GET["limit"];  //

// file_put_contents("abc.txt",json_encode($_GET));



if($offset==0){
    
    
    $____res_cat____=$base->doSql('select * from hkcms_archives where category_id="'.$category_id.'" limit 0,'.$limit);
}else{
    $____res_cat____=$base->doSql('select * from hkcms_archives where category_id="'.$category_id.'" limit '.$offset.','.$limit);
}

$____count____=$base->doSql('select * from hkcms_archives where category_id="'.$category_id.'"');


$data=[
    "total"     =>count($____count____),
    "rows"      =>$____res_cat____
];



return json($data);














return json($data);